<?php
class sequence_characteristics {
	private $sequenceid;
	private $sequence_characteristic_composit;
	public  $dg;
	public  $G;
	public  $da;
	public  $t;
	public  $M1;
	public  $M2;
	public  $M3;
	public  $M4;
	public  $M5;
	public  $M6;
	public  $M7;
	public  $Vi;
	public  $Di;
	public  $CKOi;
	public  $M3i;
	public  $Assimetryi;
	public  $M4i;
	public  $Exsessi;
	
	/**
	 * Constructor
	 *
	 * @param int sequenceid
	 */
	public function __construct($sequenceid = null) {
		$sequence_characteristic_composit = new sequence_characteristic_composition();
		$sequence_characteristic =new sequence_characteristic_composition();
		$criteria = new query_criteria();
		$criteria->add_criterion_composite($sequence_characteristic_composit->sequence, $sequence_characteristic_composit->sequence->sequence_id , criterion_type::$equal, $sequenceid);
		$sequence_iterator= db_adapter::get_instance()->get_composite_list($sequence_characteristic_composit, $criteria,$total);
		if ($total < 1) return false;

		while (($sequence_characteristic = $sequence_iterator->get_next(false, true)) !== false) {
			switch ($sequence_characteristic->chain_characteristic_type->chain_characteristic_type_name->get_value()) {
				case "dg":
					 $this->dg =$sequence_characteristic->chain_characteristic->start_value->get_value();
				case "G":
					 $this->G = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "da":
					 $this->da = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "t":
					 $this->t = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "M1":
					$this->M1 = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "M2":
					$this->M2 = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "M3":
					$this->M3 = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "M4":
					$this->M4 = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "M5":
					$this->M5 = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "M6":
					$this->M6 = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "M7":
					$this->M7 = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "Vi":
					$this->Vi = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "Di":
					$this->Di = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "CKOi":
					$this->CKOi = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "M3i":
					$this->M3i = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "Assimetryi":
					$this->Assimetryi = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "M4i":
					$this->M4i = $sequence_characteristic->chain_characteristic->start_value->get_value();
				case "Exsessi":
					$this->Exsessi = $sequence_characteristic->chain_characteristic->start_value->get_value();
			}
		}

		return true;
	}
		
	
}
?>